package com.woniu.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniu.bean.User;
import com.woniu.entity.dto.UserDTO;
import com.woniu.mapper.UserMapper;
import com.woniu.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class IUserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {
    @Autowired(required = false)
    private UserMapper userMapper;


    @Override
    public IPage<User> pageSelect(Integer currentPage, Integer pageSize, UserDTO userDTO) {
//        构建分页对象
        IPage<User> page = new Page<>();
//        调用mapper查询
        IPage<User> listPage= userMapper.pageSelect(page,userDTO);
//        返回数据
        return listPage;
    }
}
